package com.leo;

import com.jfoenix.controls.JFXSlider;
import javafx.application.Application;
import javafx.geometry.Orientation;
import javafx.scene.Scene;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;

import java.net.URL;

/**
 * @ClassName JFXSliderDemo
 * @Description
 * @Author wangss
 * @date 2020.11.26 12:17
 * @Version 1.0
 */
public class JFXSliderDemo extends Application {

    public static void main(String[] args) {
        launch(args);
    }

    @Override
    public void start(Stage primaryStage) throws Exception {
        JFXSlider hor_left = new JFXSlider();
        hor_left.setMinWidth(500);
        JFXSlider hor_right = new JFXSlider();
        hor_left.setMinWidth(500);
        hor_left.setIndicatorPosition(JFXSlider.IndicatorPosition.RIGHT);
        JFXSlider ver_left = new JFXSlider();
        ver_left.setMinHeight(500);
        ver_left.setOrientation(Orientation.VERTICAL);
        JFXSlider ver_right = new JFXSlider();
        ver_right.setMinHeight(500);
        ver_right.setOrientation(Orientation.VERTICAL);
        ver_right.setIndicatorPosition(JFXSlider.IndicatorPosition.RIGHT);

        AnchorPane an = new AnchorPane();
        an.getChildren().addAll(hor_left, hor_right, ver_left, ver_right);

//        AnchorPane.setTopAnchor(javaRadio, 20.0);
//        AnchorPane.setLeftAnchor(javaRadio, 20.0);

//        AnchorPane.setTopAnchor(jfxRadio, 60.0);
//        AnchorPane.setLeftAnchor(jfxRadio, 20.0);

        Scene scene = new Scene(an);
        URL url = this.getClass().getResource("/css/myStyle.css");
        scene.getStylesheets().add(url.toExternalForm());
        primaryStage.setScene(scene);
        primaryStage.setWidth(800);
        primaryStage.setHeight(650);
        primaryStage.setTitle("JFoeniX测试");
        primaryStage.show();
    }
}
